import React, { Component } from 'react'
import { Route, Switch, Redirect, BrowserRouter as Router } from 'react-router-dom'
import App from './components/App'
import Home from './components/Home'
class BasicRouter extends Component {
  render () {
    return (<Router>
        <Switch>
          {/* 根路径一定要加精确匹配 */}
          <Route path='/' exact component = { App } />
          <Route path='/home' component = { Home } />
          {/* 请求重定向 */}
          <Redirect to='/' />
        </Switch>
      </Router>
    )
  } 
}
export default BasicRouter